package com.boot.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.boot.enums.WeekEnum;
import lombok.Data;

import java.util.List;

@Data
@TableName(value = "user",keepGlobalPrefix = true,excludeProperty = {"name"})
public class User {

    /** ID主键 自增 */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    //如果Java实体类的属性名和数据库的字段名一样 也可以省略
    @TableField(value = "userName")
    private String userName;

    @TableField(value = "password")
    private String password;

    private String name;//会把这个属性默认当做字段

    @TableField(exist = false)//排除该属性 关联查询中的比较多
    private String address;

    @TableField(exist = false)
    private List<Menu> menus;

    @Version
    private Integer version;//version和数据库的字段名一样 所以不需要另外指定

    @TableField("week")
    private WeekEnum week;

    @TableField(value = "deleteStatus")
//    @TableLogic
    private Integer deleteStatus;

}
